<?php


namespace App\Http\Utils;


class Api
{

    const SUCCESS=200;
    const ERROR=500;
    /**
     * @param int $code
     * @param array $data
     * @param string $msg
     * @return array
     */
    public static function Success($code=200,$data=[],$msg=""){

        return [
            'code'=>$code,
            'data'=>$data,
            'msg'=>$msg,
        ];
    }

    /**
     * @param int $code
     * @param string $msg
     * @return array
     */
    public static function Fail($msg="",int $code=500){

        return [
            'code'=>$code,
            'msg'=>$msg,
        ];
    }
}
